<?php
/**
 * Created by PhpStorm.
 * User: win7
 * Date: 2018/5/11 0011
 * Time: 17:22
 */

namespace Wx\Controller;
use Think\Controller;

class NoController extends Controller
{
    public function Index(){
        $typename = I("get.typename");
        $this->assign('typename',$typename);
        $this->display('no');
    }//end fun index

    //申请用户
    public function apply(){
        $store = M('shop_store');
        $u_id = session('u_id');
        $member = getMember($u_id);
        $post_store = I("post.");
        if ($post_store){
            foreach($post_store as $k => $v){
                if ($v == ' '){
                    $this->error('请填写完整');
                }
            }
            $post_store['addtime'] = time();
            $post_store['status'] = 2;
            $addstore = $store->add($post_store);
            if ($addstore){
                $this->redirect('User/index');
            }else{
                $this->error('提交错误');
            }
        }
        $this->assign($member);
        $this->display('apply');
    }//end fun apply

}//end class